sizeof operator

From Cppreference

Jump to: navigation, search

Queries size of the object or type

Used when actual size of the object must be known

Contents

[edit] Syntax

sizeof( type )
sizeof( expression )

Both versions return an object of type std::size_t.

[edit] Explanation

1) returns size in bytes of any instance of type.

2) returns size in bytes of any instance of the type, that would be returned by expression, if evaluated.

[edit] Keywords

sizeof

[edit] Example

[edit] See also

alignof, sizeof...

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox
In other languages